﻿<TreeView TItem="TreeFoo" Items="@Items" OnTreeItemClick="@OnTreeItemClick" />
<ConsoleLogger @ref="Logger" class="mt-3" />

@code {
    [NotNull]
    private ConsoleLogger? Logger { get; set; }

    private Task OnTreeItemClick(TreeViewItem<TreeFoo> item)
    {
        Logger.Log($"TreeItem: {item.Text} clicked");
        return Task.CompletedTask;
    }

    private List<TreeViewItem<TreeFoo>> Items { get; set; } = TreeFoo.GetTreeItems();
}
